package com.training.java.core.inheritance;



	public class Car2 {
		String color;
		String vinNumber;
		int maximumSpeed = 150;
		int currentSpeed;
		int numberOfGears = 5;
			
		public String getColor() {
			return color;
		}
		public void setColor(String color) {
			this.color = color;
		}
		public String getvinNumber() {
			return vinNumber;
		}
		public void setvinNumber(String vinNumber) {
			this.vinNumber = vinNumber;
		}
		public int getmaximumSpeed() {
			return maximumSpeed;
		}
		public void setmaximumSpeed(int maximumSpeed) {
			this.maximumSpeed = maximumSpeed;
		}
		int accelerate(int howMuch) {
			int wishfulCurrentSpeed = currentSpeed + howMuch;
			
			if (wishfulCurrentSpeed > maximumSpeed) {
				currentSpeed = maximumSpeed;
			}else{
				currentSpeed = wishfulCurrentSpeed;
			}
			return currentSpeed;
		}
		public int getnumberOfGears() {
			return numberOfGears;
		}
		public void setnumberOfGears(int numberOfGears) {
			this.numberOfGears = numberOfGears;
		}

	}

	
		
	

